const { defineConfig } = require('@vue/cli-service')
module.exports = defineConfig({
  transpileDependencies: true,
  devServer: {
    host: '0.0.0.0', // 监听所有网卡，允许外部访问
    port: 8080, // 指定端口
    allowedHosts: 'all', // 允许所有主机访问，支持域名访问
    hot: false,
    liveReload: false,
    client: {
      overlay: false,
      progress: false,
      webSocketTransport: 'sockjs'
    },
    webSocketServer: false,
    // 支持内网穿透的额外配置
    headers: {
      'Access-Control-Allow-Origin': '*',
      'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, PATCH, OPTIONS',
      'Access-Control-Allow-Headers': 'X-Requested-With, content-type, Authorization'
    }
  }
})
